package util.utls;

import android.graphics.Color;
import android.os.CountDownTimer;
import android.text.Spannable;
import android.text.SpannableString;
import android.text.style.ForegroundColorSpan;
import android.widget.Button;
import android.widget.TextView;

import com.itboye.hutoubenjg.R;

/**
 * Created by itboye on 2016/12/5.
 */

public class Timer extends CountDownTimer{


    private TextView tv;

    public Timer(long millisInFuture, long countDownInterval, TextView tv) {
        super(millisInFuture, countDownInterval);
        this.tv=tv;
    }



    @Override
    public void onFinish() {
        tv.setText("重新验证");
        tv.setClickable(true);
    }

    @Override
    public void onTick(long millisUntilFinished) {
        tv.setClickable(false);
        tv.setText(millisUntilFinished / 1000 + "秒后重新发送");

    }
}
